package com.luych.toolbox.data.service.convert;

import com.luych.toolbox.common.feign.param.data.service.DataTransporterPlanParam;
import com.luych.toolbox.common.service.base.BaseConvert;
import com.luych.toolbox.data.service.entity.DataTransporterPlan;
import org.springframework.beans.BeanUtils;

public class DataTransporterPlanParamToEntity implements BaseConvert<DataTransporterPlanParam, DataTransporterPlan> {

    @Override
    public DataTransporterPlan target() {
        return new DataTransporterPlan();
    }

    @Override
    public void accept(DataTransporterPlanParam source, DataTransporterPlan target) {
        BeanUtils.copyProperties(source, target, "tables", "tableMap");
        target.setTableMap(source.getTables());
    }
}
